package com.isnmp.nms.framework.discover;

import java.io.Serializable;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;

import com.isnmp.common.snmp.SNMPTarget;
import com.isnmp.common.snmp.mib.Dot1dBasePortEntry;
import com.isnmp.common.snmp.mib.Dot1dTpFdbEntry;
import com.isnmp.common.snmp.mib.MibIPAddrEntry;
import com.isnmp.common.snmp.mib.MibIPRouterEntry;
import com.isnmp.common.snmp.mib.MibIfEntry;
import com.isnmp.common.snmp.mib.MibMacIP;

@SuppressWarnings("rawtypes")
public class DeviceInfo implements Serializable {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private String deviceIP = "";
    private String deviceMAC = "";
    private String deviceName = "";
    private String deviceProtocol = "";
    private String deviceDesc = "";
    private String deviceSysOID = "";
    private SNMPTarget snmpTarget = null;
    private DeviceTypeInfo deviceType = DeviceTypeInfo.UnkownType;

    @SuppressWarnings("unchecked")
    private List<MibIPAddrEntry> ipaddressList = new Vector();
    @SuppressWarnings("unchecked")
    private List<MibIPRouterEntry> routerTableList = new Vector();
    @SuppressWarnings("unchecked")
    private List<MibIfEntry> ifTableList = new Vector();
    @SuppressWarnings("unchecked")
    private List<Dot1dTpFdbEntry> dTpFdbTableList = new Vector();
    @SuppressWarnings("unchecked")
    private List<Dot1dBasePortEntry> basePortList = new Vector();
    @SuppressWarnings("unchecked")
    private List<MibMacIP> mibMacIPList = new Vector();
    @SuppressWarnings("unchecked")
    private List<String> deviceMacList = new Vector();
    @SuppressWarnings("unchecked")
    private List<PortInfo> portInfoList = new Vector();
    public static final String DeviceProtocolSNMP = "SNMP";
    public static final String DeviceProtocolPing = "Ping";

    public String toString() {
        return "IP:" + this.deviceIP + ",name:" + this.deviceName + ",type:" + this.deviceType;
    }

    public String getDeviceIDCode() {
        String str = "";
        Iterator localIterator = this.ifTableList.iterator();
        while (localIterator.hasNext()) {
            MibIfEntry localMibIfEntry = (MibIfEntry) localIterator.next();
            str = str + localMibIfEntry.getIfPhysAddress();
        }
        return str;
    }

    public boolean equals(Object paramObject) {
        if ((paramObject instanceof DeviceInfo)) {
            DeviceInfo localDeviceInfo = (DeviceInfo) paramObject;
            if (getDeviceIP().equals(localDeviceInfo.getDeviceIP()))
                return true;
            if ((localDeviceInfo.getDeviceMAC() != null) && (!localDeviceInfo.getDeviceMAC().equals("")) && (!localDeviceInfo.getDeviceMAC().equals("00:00:00:00:00:00")) && (localDeviceInfo.getDeviceMAC().equalsIgnoreCase(getDeviceMAC())))
                return true;
            if ((!getDeviceIDCode().equals("")) && (getDeviceIDCode().equals(localDeviceInfo.getDeviceIDCode()))) {
                System.out.println(Messages.getString("DeviceInfo.15") + this + ";" + paramObject);
                return true;
            }
        }
        return false;
    }

    public void setDeviceSysOID(String paramString) {
        this.deviceSysOID = paramString;
    }

    public String getDeviceSysOID() {
        return this.deviceSysOID;
    }

    public String getDeviceIP() {
        return this.deviceIP;
    }

    public void setDeviceIP(String paramString) {
        this.deviceIP = paramString;
    }

    public List<String> getDeviceMacList() {
        return this.deviceMacList;
    }

    public void setDeviceMacList(List<String> paramList) {
        this.deviceMacList = paramList;
    }

    public String getDeviceMAC() {
        return this.deviceMAC;
    }

    public void setDeviceMAC(String paramString) {
        this.deviceMAC = paramString;
    }

    public String getDeviceName() {
        return this.deviceName;
    }

    public void setDeviceName(String paramString) {
        this.deviceName = paramString;
    }

    public String getDeviceDesc() {
        return this.deviceDesc;
    }

    public void setDeviceDesc(String paramString) {
        this.deviceDesc = paramString;
    }

    public SNMPTarget getSnmpTarget() {
        return this.snmpTarget;
    }

    public void setSnmpTarget(SNMPTarget paramSNMPTarget) {
        this.snmpTarget = paramSNMPTarget;
    }

    public void setDeviceType(DeviceTypeInfo paramDeviceTypeInfo) {
        this.deviceType = paramDeviceTypeInfo;
    }

    public DeviceTypeInfo getDeviceType() {
        return this.deviceType;
    }

    public void setDeviceProtocol(String paramString) {
        this.deviceProtocol = paramString;
    }

    public String getDeviceProtocol() {
        return this.deviceProtocol;
    }

    public void setIfTableList(List<MibIfEntry> paramList) {
        this.ifTableList = paramList;
    }

    public List<MibIfEntry> getIfTableList() {
        return this.ifTableList;
    }

    public List<MibMacIP> getMibMacIPList() {
        return this.mibMacIPList;
    }

    public void setMibMacIPList(List<MibMacIP> paramList) {
        this.mibMacIPList = paramList;
    }

    public List<PortInfo> getPortInfoList() {
        return this.portInfoList;
    }

    public void setPortInfoList(List<PortInfo> paramList) {
        this.portInfoList = paramList;
    }

    public List<Dot1dTpFdbEntry> getdTpFdbTableList() {
        return this.dTpFdbTableList;
    }

    public void setdTpFdbTableList(List<Dot1dTpFdbEntry> paramList) {
        this.dTpFdbTableList = paramList;
    }

    public List<MibIPAddrEntry> getIpaddressList() {
        return this.ipaddressList;
    }

    public void setIpaddressList(List<MibIPAddrEntry> paramList) {
        this.ipaddressList = paramList;
    }

    public List<MibIPRouterEntry> getRouterTableList() {
        return this.routerTableList;
    }

    public void setRouterTableList(List<MibIPRouterEntry> paramList) {
        this.routerTableList = paramList;
    }

    public List<Dot1dBasePortEntry> getBasePortList() {
        return this.basePortList;
    }

    public void setBasePortList(List<Dot1dBasePortEntry> paramList) {
        this.basePortList = paramList;
    }
}